<?php
 ob_start();
?>
<div class="modal homepage-modal">
    <div class="modal-header">
		<button type="button" class="close freevf_close">&times;</button>
		<h3><?php _e('Free Stock Images - Add Images to Blog Posts', FVF_TED); ?></h3>
    </div>
    <div class="modal-body">
		<div class="image-wall">
			<div class="image-wall-item">
			   <?php
                 for( $ic=0 ; $ic < 9;$ic ++){
                 	$left = $ic*95;
			   ?>
				<div class="image-wall-node" style="top:0; left:<?php echo $left;?>px;">
				      <a href="<?php echo admin_url('admin-ajax.php?action=freevf_proxy&show=detail&npage=index&imgId='.$bdimg[$ic]['id']).'&post_id='.$post_id;?>" alt="<?php echo $bdimgs[$ic]['title'];?>">
				      <span style="width:150px; height:100px;margin:<?php echo $bdimgs[$ic]['margin_top'];?>px 0 0 <?php echo $bdimgs[$ic]['margin_left'];?>px;"> <img src="<?php echo $bdimgs[$ic]['grid_url'];?>" alt="<?php echo $bdimgs[$ic]['title'];?>" /></span>
				      </a>
				</div>
				<?php
                   }
                   for( $ic= 1 ,$tc=9 ; $ic < 7; $ic++, $tc++){
                   	$top = ceil( $ic /2)*95;
                   	$left = ($ic%2) == 0 ? '760px' : '0';

				?>
				<div class="image-wall-node" style="top:<?php echo $top;?>px; left:<?php echo $left;?>;">
				     <a href="<?php echo admin_url('admin-ajax.php?action=freevf_proxy&show=detail&npage=index&imgId='.$bdimgs[$tc]['id']).'&post_id='.$post_id;?>" alt="<?php echo $bdimgs[$tc]['title'];?>">
				         <span style="width:150px; height:150px;margin:<?php echo $bdimgs[$tc]['margin_top'];?>px 0 0 <?php echo $bdimgs[$tc]['margin_left'];?>px;"><img src="<?php echo $bdimgs[$tc]['grid_url'];?>" alt="<?php echo $bdimgs[$tc]['title'];?>"  /></span>
				     </a>
				</div>
				<?php
                  }
                  for( $ic = 0 ,$tc =15 ; $ic< 9 ; $ic ++ , $tc++){
                  	$left = $ic*95;
				?>
				<div class="image-wall-node" style="top:380px; left:<?php echo $left;?>px;">
				   <a href="<?php echo admin_url('admin-ajax.php?action=freevf_proxy&show=detail&npage=index&imgId='.$bdimgs[$tc]['id']).'&post_id='.$post_id;?>" alt="<?php echo $bdimgs[$tc]['title'];?>">
				      <span style="width:150px; height:150px;margin:<?php echo $bdimgs[$tc]['margin_top'];?>px 0 0 <?php echo $bdimgs[$tc]['margin_left'];?>px;"><img src="<?php echo $bdimgs[$tc]['grid_url'];?>" alt="<?php echo $bdimgs[$tc]['title'];?>"  /></span>
				   </a>
			    </div>
			    <?php
                   }
			    ?>
			</div>
			<!-- // image-wall-item end -->

			<div class="image-wall-inside">
				<div class="image-wall-logo">
					<a href="http://www.onlyimage.com/" target="_blank"><img src="<?php echo  freevf_pg_url('res/images/onlyimage.png', FVF_FILE);?>" alt="<?php _e('Visit onlyimage.com',FVF_TED);?>" /></a>
				</div>
				<div class="image-wall-search">
					<form action="<?php echo admin_url('admin-ajax.php?action=freevf_proxy&show=search&post_id='.$post_id);?>" method="POST" >
						<input type="text" name="r[keyword]" class="search-input" value=""
						          placeholder="<?php _e('Enter a keyword to start searching 5,000,000 free images ...',FVF_TED);?>" />
						<input type="hidden" name="r[page]" value="1" >
						<input type="hidden" bame="r[color]" value="all">
						<button class="search-submit" type="submit"><?php _e('Search' ,FVF_TED);?></button>
					</form>
				</div>
				<!-- homepage-search end -->
			</div>
			<!-- //image-wall-inside end -->
		</div>
		<!-- // image-wall end -->

		<div class="homepage-categories">
			<p class="homepage-tags">
			  <?php
                 if( $cates && is_array( $cates) && count( $cates )) {
                  foreach( $cates as $_vc){
			   ?>
				<a href="<?php echo admin_url('admin-ajax.php?action=freevf_proxy&show=cate&post_id='.$post_id.'&category='.urlencode( $_vc['category_url']));?>" alt="<?php echo $_vc['category_name'];?>">
				     <?php echo $_vc['category_name'];?>
				 </a>
				<?php
                  }
                 }
				?>
			</p>
		</div>
		<!-- // homepage-categories end -->
    </div>
 </div>
<!-- modal.homepage-modal end -->
<?php
 $_maintpl=ob_get_contents();
ob_end_clean();
?>